import java.util.Random;

/**
 * Created by jxy6996 on 2017/6/4.
 */
public class MakeQuestions {
    private Random r1 = new Random();
    private Operand opd = new Operand();
    private String operator;
    private String expr;

    public MakeQuestions(){

    }

    public String getExper(int i){
        expr = opd.getOp1() + getOperator();
        for (int j = 0; j < i-1; j++) {
            String s = opd.getOp1() + getOperator();
            expr += s;
        }
        expr = expr + opd.getOp2();
        return expr;
    }

    private String getOperator(){
        int i = r1.nextInt(4);
        if (i == 0){
            operator = " + ";
        }
        else if (i == 1){
            operator = " - ";
        }
        else if (i == 2){
            operator = " * ";
        }
        else if (i == 3){
            operator = " / ";
        }
        return operator;
    }
}